home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
misc
/
tritonrexx376.lha
/
TritonRexx
/
Programme
/
Exchange.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1995-09-17
|
13KB
|
414 lines
/*
$VER: Exchange.rexx V1.0 (17.9.95) Copyright by Nils Goers
This ARexx script was written using the tritonrexx.library and
rexxtricks.library from Juergen Kohrmeyer <j_kohrmeyer@wilam.north.de>.
This Script needs HandleCX from Martin Berndt.
*/
/* temporary Filename */
Tmp.Out = "t:HandleCX.out"
/* Name and path from Martin Berndt's 'HandleCX' */
HandleCX = "HandleCX"
/************************************************
* Please don't change anything under this line *
************************************************/
NL = '0a'x
PARSE ARG PubScreen
IF PubScreen == "?" THEN DO
OPTIONS PROMPT "PUBSCREEN/K: "
PARSE PULL PubScreen
END
IF PubScreen == "" THEN
PubScreen = "Workbench"
IF ~SHOW('LIBRARIES','tritonrexx.library') THEN DO
IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN DO
SAY 'Kann die <tritonrexx.library> nicht oeffnen!'
EXIT(10)
END
END
IF ~SHOW('LIBRARIES','rexxtricks.library') THEN DO
IF ~ADDLIB('rexxtricks.library',10,-30,0) THEN DO
SAY 'Kann die <rexxtricks.library> nicht oeffnen!'
EXIT(10)
END
END
call _CreateList
/*
** Beschreibung der Applikation
*/
appname = 'Exchange'
applongname = 'Exchange - 1995 by Nils Goers'
appinfo = 'Tool for Commodity controlling'
appversion = '1.0'
apprelease = '1'
appdate = '17.9.95'
Activation.0 = 2
Activation.1 = "[a]ctive"
Activation.2 = "in[a]ctive"
Activation2.0 = 2
Activation2.1 = "Deact[i]vate all"
Activation2.2 = "Act[i]vate all"
IF active.1 == "INACTIVE" THEN N1 = 1
_maintags:
windowtags = WindowID(1),
PubScreenName(PubScreen),
WindowTitle(appname appversion),
BeginMenu("Project"),
MenuItem("A_About",10),
MenuItem("About Triton",11) ItemBarlabel,
MenuItem("U_Update Toollist",12),
MenuItem("P_Update PubScreen",14) ItemBarlabel,
MenuItem("Q_Quit",13),
'HorizGroupA Space VertGroupA Space',
NamedSeparatorIN("Available _commodities",1),
'Space',
ListSS('Tools',1,0,0),
'EndGroup',
'VertGroupA SpaceB SpaceB',
GetEntryButton(12) 'SpaceB SpaceB SpaceB SpaceB SpaceB SpaceB SpaceB SpaceB',
'EndGroup',
'SpaceS',
'VertGroupA Space',
NamedSeparator("Informations"),
'Space',
'TROB_FrameBox TRFB_Text',
'VertGroupA',
'SpaceS',
ClippedTextID(Information.1,2),
ClippedTextID(Information2.1,22),
'Space EndGroup',
'SpaceB',
'BeginLine',
Button("_Show Window",3),
'SpaceS',
Button("_Hide Window",4),
'EndLine',
'SpaceS',
'BeginLine',
CycleGadget(activation,n1,5),
'SpaceS',
Button(" _Remove ",6),
'EndLine',
'SpaceS',
'BeginLine',
CycleGadget(activation2,0,7),
'SpaceS',
Button(" Remove all ",8),
'EndLine',
'Space EndGroup Space EndGroup EndProject'
/*
** Unterbrechungssignale
*/
SIGNAL ON break_c
SIGNAL ON failure
SIGNAL ON halt
SIGNAL ON ioerr
SIGNAL ON syntax
app = TR_CREATEAPP('TRCA_Name' '"'appname'"',
'TRCA_LongName' '"'applongname'"',
'TRCA_Info' '"'appinfo'"',
'TRCA_Version' '"'appversion'"',
'TRCA_Release' '"'apprelease'"',
'TRCA_Date' '"'appdate'"',
'TAG_END')
IF app ~= '00000000'x THEN DO
window = TR_OPENPROJECT(app,windowtags)
WindowProject=C2D(window) /* zum Locken des Fensters bei About */
IF window ~= '00000000'x THEN DO
ende = 0
IF GUI.1 == "NOGUI" THEN DO
CALL TR_SETATTRIBUTE(window,3,'TRAT_Disabled',1)
CALL TR_SETATTRIBUTE(window,4,'TRAT_Disabled',1)
END
DO WHILE ende ~= 1
CALL TR_WAIT(app,'')
/* 1 = ListView
3 = ShowWindow
4 = HideWindow
5 = Cycle 1
6 = Remove
7 = Cycle 2
8 = Remove all
10 = About
11 = About Triton
12 = Update
13 = Quit
14 = Update Screen
*/
DO WHILE TR_HANDLEMSG(app,'event')
IF event.trm_class = 'TRMS_KEYPRESSED' THEN DO
IF event.trm_code == 32 THEN CALL _InActivate
IF event.trm_code == 23 THEN DO
nummer = TR_GETATTRIBUTE(window,7,'TRAT_Value')
IF Nummer == 0 THEN
CALL TR_SETATTRIBUTE(window,7,'TRAT_Value',1)
ELSE
CALL TR_SETATTRIBUTE(window,7,'TRAT_Value',0)
CALL _InActivateALL
END
END
IF event.trm_class = 'TRMS_ACTION' THEN DO
nummer = TR_GETATTRIBUTE(window,1,'TRAT_Value')+1
SELECT
WHEN event.trm_id = 3 THEN
ADDRESS COMMAND HandleCX '"'tools.nummer'"' 'POPUP'
WHEN event.trm_id = 4 THEN
ADDRESS COMMAND HandleCX '"'tools.nummer'"' 'HIDE'
WHEN event.trm_id = 6 THEN DO
ADDRESS COMMAND HandleCX '"'tools.nummer'"' 'REMOVE'
CALL _CreateList
CALL TR_SETATTRIBUTE(window,1,'TROB_Listview',Tools)
nummer = TR_GETATTRIBUTE(window,1,'TRAT_Value')+1
CALL TR_SETATTRIBUTE(window,2,'TRAT_Text',Information.nummer)
CALL TR_SETATTRIBUTE(window,22,'TRAT_Text',Information2.nummer)
call _CheckGUI
call _CheckActive
END
WHEN event.trm_id = 8 THEN DO
DO i = 1 to tools.0
ADDRESS COMMAND HandleCX '"'Tools.i'"' 'REMOVE'
END
CALL _CreateList
CALL TR_SETATTRIBUTE(window,1,'TROB_Listview',Tools)
CALL _CheckGUI
CALL _CheckActive
END
WHEN event.trm_id = 10 THEN DO
CALL TR_EasyRequest(app,"Exchange.rexx V1.0 (17.9.95)",
NL NL"(c) 1995 Nils Goers <N.Goers@Art-Line.Art-Line.de>",
NL"- freely distributable -","OK","TREZ_Title About TREZ_LockProject" WindowProject)
END
WHEN event.trm_id = 11 THEN DO
CALL TR_EasyRequest(app,"This application uses the Triton GUI creation system",
NL"Triton is (C) by Stefan Zeiger <s.zeiger@laren.rhein-main.de>",
NL NL"This application was written using the tritonrexx.library",
NL"tritonrexx.library is (C) by Juergen Kohrmeyer <j_kohrmeyer@wilam.north.de>",,
"OK","TREZ_Title" '"About Triton"' "TREZ_LockProject" WindowProject)
END
WHEN event.trm_id = 12 THEN DO
CALL _CreateList
CALL _CheckGUI
CALL _CheckActive
CALL TR_SETATTRIBUTE(window,1,'TROB_Listview',Tools)
CALL TR_SETATTRIBUTE(window,1,'TRAT_Value',Nummer-1)
CALL TR_SETATTRIBUTE(window,2,'TRAT_Text',Information.nummer)
CALL TR_SETATTRIBUTE(window,22,'TRAT_Text',Information2.nummer)
END
WHEN event.trm_id = 14 THEN CALL _NewPubScreen
WHEN event.trm_id = 13 THEN DO
Quit=TR_EasyRequest(app,"Really Quit?",,
"_Yes|_No","TREZ_Title Quit TREZ_LockProject" WindowProject)
IF Quit == 1 THEN DO
CALL TR_CLOSEPROJECT(window)
CALL TR_DELETEAPP(app)
EXIT(0)
END
END
OTHERWISE
NOP
END
END
IF event.trm_class = 'TRMS_NEWVALUE' THEN DO
SELECT
WHEN event.trm_id = 1 THEN DO
nummer = event.trm_data+1
CALL TR_SETATTRIBUTE(window,2,'TRAT_Text',Information.nummer)
CALL TR_SETATTRIBUTE(window,22,'TRAT_Text',Information2.nummer)
call _CheckGUI
call _CheckActive
END
WHEN event.trm_id = 5 THEN CALL _InActivate
WHEN event.trm_id = 7 THEN CALL _InActivateALL
OTHERWISE
NOP
END
END
IF event.trm_class = 'TRMS_CLOSEWINDOW' THEN ende = 1
END
END
CALL TR_CLOSEPROJECT(window)
END
CALL TR_DELETEAPP(app)
END
EXIT(0)
_CreateList:
ADDRESS COMMAND HandleCX "v >"Tmp.out
IF READFILE(Tmp.Out,Infile) == 0 THEN EXIT(5)
Tools.0 = Infile.0/2
Information.0 = Tools.0
Information2.0 = Tools.0
Active.0 = Tools.0
GUI.0 = Tools.0
j = 1
DO i = 1 TO Infile.0
/* hier wird alles in die richtigen Listen verteilt,
Toolname, Active, Gui */
Tools.j=DELWORD(Infile.i,1,1)
WordNo=WORDS(Tools.j)
GUI.j = SUBWORD(Tools.j,WordNo); Active.j = SUBWORD(Tools.j,WordNo-1,1)
Tools.j = SUBWORD(Tools.j,1,WordNo-2)
/* und hier wird die Information zu dem Commodity verarbeitet */
i = i+1
Information.j=DELWORD(Infile.i,1,1)
MaxLenght=LENGTH(Information.j); Position=LASTPOS(" (",Information.j)
First=LEFT(Information.j,Position)
second=RIGHT(Information.j,Maxlenght-Position-1); second=LEFT(second,Maxlenght-Position-2)
Information.j = First
Information2.j = second
j=j+1
END
ADDRESS COMMAND "c:delete" Tmp.Out "QUIET"
RETURN
_CheckGUI:
IF gui.nummer == "NOGUI" THEN DO
CALL TR_SETATTRIBUTE(window,3,'TRAT_Disabled',1)
CALL TR_SETATTRIBUTE(window,4,'TRAT_Disabled',1)
END
ELSE DO
CALL TR_SETATTRIBUTE(window,3,'TRAT_Disabled',0)
CALL TR_SETATTRIBUTE(window,4,'TRAT_Disabled',0)
END
RETURN
_CheckActive:
IF active.nummer == "INACTIVE" THEN
CALL TR_SETATTRIBUTE(window,5,'TRAT_Value',1)
ELSE
CALL TR_SETATTRIBUTE(window,5,'TRAT_Value',0)
RETURN
_InActivate:
nummer = TR_GETATTRIBUTE(window,1,'TRAT_Value')+1
ADDRESS COMMAND HandleCX '"'Tools.Nummer'"' 'TOGGLE'
CALL _CreateList
CALL TR_SETATTRIBUTE(window,1,'TROB_Listview',Tools)
CALL _CheckGUI
CALL _CheckActive
RETURN
_InActivateALL:
nummer = TR_GETATTRIBUTE(window,7,'TRAT_Value')
IF nummer == 1 THEN Action = 'Disable'
ELSE Action = 'Enable'
DO i = 1 to tools.0
ADDRESS COMMAND HandleCX '"'tools.i'"' Action
END
CALL _CreateList
CALL TR_SETATTRIBUTE(window,1,'TROB_Listview',Tools)
CALL _CheckGUI
CALL _CheckActive
RETURN
/* Routine, die das GUI auf einem neuen PubScreen oeffnen laesst */
_NewPubScreen:
IF PUBSCREENLIST('ScreenList') == 0 THEN RETURN
ScreenListTags = WindowID(2),
WindowPosition('TRWP_MOUSEPOINTER'),
WindowTitle('Change PubScreen'),
WindowFlags('TRWF_NOCLOSEGADGET|TRWF_NOESCCLOSE'),
PubScreenName(Pubscreen),
'VertGroupA',
'Space',
'HorizGroupA',
'Space',
ListSel('screenlist',301,0),
'Space',
'EndGroup',
'Space',
'HorizSeparator',
'Space',
'HorizGroupA',
'Space',
ButtonRE('Cancel',302),
'Space',
'EndGroup Space EndGroup EndGroup EndProject'
PubScreenProject = TR_OPENPROJECT(app,Screenlisttags)
IF PubScreenProject ~= '00000000'x THEN DO
CALL TR_LOCKPROJECT(window)
DO WHILE ende ~= 1
DO WHILE TR_HANDLEMSG(app,'event2')
IF event2.trm_class = 'TRMS_ACTION' THEN ende = 1 /* Cancel Gadget */
IF event2.trm_class = 'TRMS_NEWVALUE' THEN DO
nummer = TR_GETATTRIBUTE(PubScreenProject,301,'TRAT_Value')+1
IF PubScreen ~= Screenlist.nummer THEN DO
PubScreen = ScreenList.nummer
CALL TR_UNLOCKPROJECT(window)
CALL TR_CLOSEPROJECT(PubScreenProject)
CALL TR_CLOSEPROJECT(window)
CALL TR_DELETEAPP(app)
CALL _maintags
END
ELSE ende = 1
END
END
END
ende = 0
CALL TR_UNLOCKPROJECT(window)
CALL TR_CLOSEPROJECT(PubScreenProject)
END
RETURN
/*******************************************************************************
** Routine, die bei einer Unterbrechung des Scripts aufgerufen wird
*******************************************************************************/
break_c:
failure:
halt:
ioerr:
syntax:
SAY '+++ Fehler' rc 'in Zeile' sigl '-' ERRORTEXT(rc)
SAY SOURCELINE(sigl)
IF app ~= '00000000'x THEN
CALL TR_DELETEAPP(app)
EXIT(10)
/*EOS*/